package csc.daonjpa.java.domain;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * Entity class for Account table. This is a simple POJO class with annotations to define mapping with DB table
 * @author nvu3
 *
 */
@Entity
@DiscriminatorValue(value="account")
public class Account extends BaseInfo {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5065498479054507905L;

	// accountNumber field maps with accountNumber column in Account table
	// @Id indicates that accountNumber is the primary key for Account table
	@Column(name = "name")
	private String accountName;
	
	@Column(name = "type")
	private String accountType;
	
	@ManyToOne
	@JoinColumn(name = "customerId")
	private Customer customer;
	
	/**
	 * Required constructor
	 */
	public Account() {
	
	}
	


	public Account(Long accountNumber, String accountName, String accountType) {
		super(accountNumber);
		this.accountName = accountName;
		this.accountType = accountType;
	}



	/**
	 * @return AccountName
	 */
	public String getAccountName() {
		return this.accountName;
	}

	/**
	 * Set accountName
	 * @param accountName
	 */
	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}

	/**
	 * @return AccountType
	 */
	public String getAccountType() {
		return this.accountType;
	}

	/**
	 * Set accountType
	 * @param accountType
	 */
	public void setAccountType(String accountType) {
		this.accountType = accountType;
	}
}